﻿using System.Collections.Generic;

namespace HSGD.Common.Extensions;

public static class DictionaryExtensions {
    public static void TryAddDic<TKey, TValue>(this IDictionary<TKey, List<TValue>> dic, TKey key, TValue value) {
        if (dic.TryGetValue(key, out var old)) {
            old.Add(value);
        }
        else {
            dic.Add(key, new List<TValue> { value });
        }
    }
}